package com.fz.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

/**
 * Created by bai on 2017/7/5.
 */
@Component
@Data
@AllArgsConstructor
@Aspect
public class Student {

    private String name;

    private String address;

    private double score;
    @Autowired
    private Teacher teacher;

    public Student(){
        System.out.println("student 无参构造方法.......");
    }
    @PostConstruct
    public void init(){
        System.out.println("student init 方法....");
    }
    public void show(){
        System.out.println("student show 方法.....");
    }
    @PreDestroy
    public void destory(){
        System.out.println("student destory 方法.......");
    }
    @Before("execution(public * com.fz.*..*.*(..))")
    public void before (){
        System.out.println("student before 方法....");
    }
    @After("execution(public * com.fz.entity..Teacher.*(..))")
    public void after(){
        System.out.println("student after 方法......");
    }
}
